<template>
    <div class="child">
        <h2>我是子组件</h2>
        {{sum}}
        <Son/>
    </div>
</template>

<script>
import Son from '../components/Son.vue'
import {ref} from 'vue'
export default {
  name: "App",
  components:{Son},
  async setup() {
      let sum = ref(0)
    //   return{
    //       sum
    //   }

   let p =   new Promise((resolve,reject)=>{
        setTimeout(() => {
            resolve(sum)
        }, 2000);
    })

    return await p
  },
};
</script>

<style>
.child{
    padding: 10px;
    background-color:orange;
}
</style>
